<template>
  <el-card class="drawing-manage" shadow="nerve">
    <!--搜索表单区域 isToggle：是否可收缩/展开 BEGIN-->
    <form-box v-model="searchForm" isToggle isSingleRow>
      <form-item label="项目名">
        <el-input v-model="searchForm.proName" type="text" placeholder="输入项目名"></el-input>
      </form-item>
      <form-item label="项目负责人">
        <el-input v-model="searchForm.proLeader" type="text" placeholder="输入项目负责人"></el-input>
      </form-item>
      <!--收起时隐藏-->
      <template #hidden>
        <form-item>
          <el-input type="text"></el-input>
        </form-item>
        <form-item>
          <el-input type="text"></el-input>
        </form-item>
      </template>
      <template #button>
        <a-button @click="handleSearch" type="primary" icon="search">查询</a-button>
        <a-button @click="searchForm={}" type="primary" icon="reload" style="margin-left: 6px">重置</a-button>
      </template>
    </form-box>
    <base-table
      :columns="table.columns"
      v-model="table.dataSource"
      :selectedRowKeys="selectedRowKeys"
      @change="selectedRowKeysChange"
      :pagination="iPagination"
      :tableChange="handleTableChange"
      :defaultValue=table.defaultValue
    >
      <template slot="action" slot-scope="r">
        <a-button size="small" type="danger">删除</a-button>
      </template>
    </base-table>

  </el-card>
</template>

<script>
  import '@/styles/auto-style.css'
  import { CommonMixins } from "@/mixins/CommonMixins";
  import FormBox from '@/components/Page/FormBox'
  import FormItem from '@/components/Page/FormItem'
  import BaseDialog from '@/components/Page/BaseDialog'
  import BaseTable from '@/components/Page/BaseTable'

  export default {
    mixins: [CommonMixins],
    components: {
      FormBox,
      FormItem,
      BaseDialog,
      BaseTable
    },
    created() {

    },
    data() {
      return {
        table: {
          columns: [
            {
              key: 'id',
              title: 'id'
            },
            {
              key: 'name',
              title: 'name'
            },
            {
              key: 'model',
              title: 'model'
            },
            {
              key: 'params',
              title: 'params'
            },
            {
              key: 'action',
              title: '操作'
            },
          ],
          dataSource: [
            {
              id: 1,
              name: 'hahha',
              model: 'jajj',
              params: 'jajj',
            },
            {
              id: 2,
              name: 'hahha',
              model: 'jajj',
              params: 'jajj',
            },
          ],
          defaultValue: ['id','name','params']
        }
      }
    },
    methods: {
      selectedRowKeysChange(val) {
        this.selectedRowKeys = val
      }
    }
  }
</script>

<style lang="scss" scoped>

</style>
